<template>
  <div class="Echarts">
    <div>
      <el-card class="box-card">
        实时接入检测    &nbsp;
        <el-switch v-model="checkEveryTime" active-text="on" inactive-text="off"></el-switch>
        <br />
        <br />区块链接入认证  &nbsp;
        <el-switch v-model="verifyBlockChain" active-text="on " inactive-text="off" ></el-switch>
      </el-card>
    </div>
    <div id="main" style="width: 100%; height: 500%" ref="test"></div>

    <el-descriptions title="异构网络" :column="3" border>
      <el-descriptions-item
        label="UE连接数量"
        label-class-name="my-label"
        content-class-name="my-content"
      >{{ ueNum }}</el-descriptions-item>
      <el-descriptions-item label="基站数量">{{baseName}}</el-descriptions-item>
    </el-descriptions>
    <el-button type="success" @click="ueConnected()">手机状态更新</el-button>
    <el-button type="success" @click="baseConnected()">更新基站状态</el-button>
    <el-button type="success" @click="discontrol()">关闭防火墙</el-button>
    <el-button type="success" @click="microservice()">微服务</el-button>
  </div>
</template>

<script>
import Axios from 'axios'
export default {
  name: 'Echarts',
  data () {
    return {
      ueNum: 0,
      baseName: 0,
      network: 0,
      IMSI: '',
      accessTime: '',
      enbList: [],
      compareEnbList: [],
      ueList: [],
      compareUeList: [],
      checkEveryTime: false,
      verifyBlockChain: false
    }
  },
  methods: {
    microservice(){
        Axios({ method: 'get', url: '/micro_api/python/index' }).then(res => {
        console.log(res.data)
      })
    },
    discontrol () {
      Axios({ method: 'get', url: '/python_api/discontrol' }).then(res => {
        console.log(res.data)
      })
    },
    control (imsi) {
      Axios({
        method: 'get',
        url: '/python_api/control?imsi=' + imsi + '&' + 'code=' + '200'
      }).then(res => {
        console.log(res.data)
      })
    },
    ueConnected () {
      Axios({
        method: 'get',
        url: '/api/stats'
      }).then(res => {
        this.accessTime = res.data.date_time
        // 防止UE为空
        res.data.eNB_config.forEach((v1, _) => {
          if (JSON.stringify(v1.UE) != '{}') {
            v1.UE.ueConfig.forEach((v2, _) => {
              // 比较列表作用是用来和上次列表情况进行比较，多出来的是新增的，少掉的是断开的
              if (v2.imsi != 0) {
                this.compareUeList.push(v2.imsi)
              }
            })
          }
        })
        // 遍历比较列表，如果在原列表中不存在，则进行区块链验证
        this.compareUeList.forEach((v1, _) => {
          if (!this.ueList.includes(v1)) {
            const h = this.$createElement
            // 区块链认证
            if (this.verifyBlockChain) {
              Axios({
                method: 'post',
                url: 'http://10.0.1.105/getVerifyCredentialResult',
                data: {
                  UE: {
                    ueConfig: [
                      {
                        rnti: 21221,
                        timeAlignmentTimer: 4294967295,
                        measGapConfigPattern: 4294967295,
                        measGapConfigSfOffset: 4294967295,
                        transmissionMode: 0,
                        ueAggregatedMaxBitrateUL: '0',
                        ueAggregatedMaxBitrateDL: '0',
                        capabilities: {
                          halfDuplex: 4294967295,
                          intraSFHopping: 4294967295,
                          type2Sb1: 4294967295,
                          ueCategory: 4294967295,
                          resAllocType1: 4294967295
                        },
                        ueTransmissionAntenna: 2,
                        ttiBundling: 4294967295,
                        maxHARQTx: 4294967295,
                        betaOffsetACKIndex: 0,
                        betaOffsetRIIndex: 0,
                        betaOffsetCQIIndex: 8,
                        ackNackSimultaneousTrans: 0,
                        simultaneousAckNackCqi: 0,
                        aperiodicCqiRepMode: 3,
                        tddAckNackFeedback: 4294967295,
                        ackNackRepetitionFactor: 0,
                        extendedBsrSize: 4294967295,
                        imsi: v1,
                        info: {
                          offsetFreqServing: '-1',
                          offsetFreqNeighbouring: '-1',
                          cellIndividualOffset: ['-1'],
                          filterCoefficientRsrp: '-1',
                          filterCoefficientRsrq: '-1',
                          event: {
                            a3: {
                              a3Offset: '-1',
                              reportOnLeave: -1,
                              hysteresis: '-1',
                              timeToTrigger: '-1',
                              maxReportCells: '-1'
                            }
                          }
                        }
                      }
                    ]
                  }
                }
              }).then(res => {
                if (res.data.errorMessage === 'success') {
                  this.$notify({
                    title: 'UE区块链认证成功',
                    message: 'IMSI: ' + v1 + '\n接入时间: ' + this.accessTime,
                    type: 'success'
                  })
                } else {
                  this.$notify({
                    title: 'UE区块链认证失败',
                    message: 'IMSI: ' + v1 + '\n接入时间: ' + this.accessTime,
                    type: 'warning'
                  })
                  this.control(v1)
                }
              })
            } else {
              this.$notify({
                title: 'UE接入成功',
                message: 'IMSI: ' + v1 + '\n接入时间: ' + this.accessTime,
                type: 'success'
              })
            }
          }
        })
        this.ueList.forEach((v2, _) => {
          if (!this.compareUeList.includes(v2)) {
            const h = this.$createElement
            this.$notify({
              title: 'UE断开连接',
              message: 'IMSI: ' + v2 + '\n断开时间: ' + this.accessTime,
              type: 'warning'
            })
          }
        })
        this.ueList = this.compareUeList
        this.compareUeList = []
        this.ueNum = this.ueList.length
        // console.log(this.ueList);
      })
    },
    baseConnected () {
      Axios({
        method: 'get',
        url: '/api/stats'
      }).then(res => {
        this.accessTime = res.data.date_time
        res.data.eNB_config.forEach((v1, _) => {
          this.compareEnbList.push(v1.bs_id)
        })
        this.compareEnbList.forEach((v1, _) => {
          if (!this.enbList.includes(v1)) {
            const h = this.$createElement
            this.$notify({
              title: '基站成功接入',
              message: '基站id: ' + v1 + '\n接入时间: ' + this.accessTime,
              type: 'success'
            })
          }
        })
        this.enbList.forEach((v2, _) => {
          if (!this.compareEnbList.includes(v2)) {
            const h = this.$createElement
            this.$notify({
              title: '基站断开连接',
              message: '基站id: ' + v2 + '\n断开时间: ' + this.accessTime,
              type: 'warning'
            })
          }
        })
        this.enbList = this.compareEnbList
        this.compareEnbList = []
        this.baseName = this.enbList.length
      })
    },
    myEcharts () {
      var myChart = this.$echarts.init(this.$refs.test)
      // 配置图表
      var option = {
        title: {
          text: '异构网络拓扑',
          left: 'center'
        },
        xAxis: {
          min: 0,
          max: 1000,
          show: false,
          type: 'value'
        },
        yAxis: {
          min: 0,
          max: 1000,
          show: false,
          type: 'value'
        },
        series: [
          {
            type: 'graph',
            coordinateSystem: 'cartesian2d',
            symbolSize: 70,
            data: [
              {
                symbol:
                  'path://M975.999737 465.300316c-0.3 110.799937-39.499978 212.49988-104.599941 292.099835-11.999993 14.699992-34.099981 15.899991-47.499973 2.499999-11.599993-11.599993-12.499993-30.199983-2.099998-42.899976 24.099986-29.499983 43.799975-62.099965 58.699966-97.299945C901.399779 570.400257 911.999773 518.000287 911.999773 464.000317c0-53.999969-10.599994-106.39994-31.399982-155.699912-20.099989-47.599973-48.999972-90.399949-85.799951-127.199928s-79.499955-65.599963-127.199928-85.799951C618.39994 74.600538 565.999969 64.000544 512 64.000544S405.60006 74.600538 356.300088 95.400526c-47.599973 20.099989-90.399949 48.999972-127.199928 85.799951s-65.599963 79.499955-85.799951 127.199928C122.600221 357.600377 112.000227 410.000348 112.000227 464.000317s10.599994 106.39994 31.399982 155.699912c14.899992 35.29998 34.59998 67.899962 58.699967 97.299945 10.399994 12.699993 9.599995 31.299982-2.099999 42.899976-13.399992 13.399992-35.39998 12.299993-47.399973-2.299999C87.300241 677.600196 48.000263 575.400254 48.000263 464.000317 48.000263 207.500462 256.100145-0.39942 512.7 0.00058c257.099854 0.4 463.999737 208.199882 463.299737 465.299736z M815.999828 464.000317c0 66.599962-21.399988 128.199927-57.699968 178.199899-11.499993 15.899991-34.49998 17.49999-48.399972 3.699998-11.099994-11.099994-12.499993-28.699984-3.199998-41.399976 10.599994-14.599992 19.399989-30.299983 26.499985-47.099974 12.499993-29.499983 18.799989-60.999965 18.799989-93.399947s-6.299996-63.899964-18.799989-93.399947c-12.099993-28.599984-29.399983-54.199969-51.499971-76.299957-22.099987-22.099987-47.699973-39.399978-76.299957-51.499971-29.599983-12.499993-60.999965-18.799989-93.399947-18.799989s-63.799964 6.299996-93.399947 18.799989c-28.599984 12.099993-54.199969 29.399983-76.299957 51.499971-22.099987 22.099987-39.399978 47.699973-51.499971 76.299957-12.499993 29.499983-18.799989 60.999965-18.799989 93.399947s6.299996 63.799964 18.799989 93.399947c7.099996 16.699991 15.899991 32.499982 26.499985 47.099974 9.199995 12.799993 7.899996 30.299983-3.199998 41.399976-13.799992 13.799992-36.899979 12.199993-48.399972-3.699998-36.299979-49.999972-57.699967-111.599937-57.699968-178.199899 0-167.899905 136.099923-303.999828 303.999828-303.999828s303.999828 136.099923 303.999828 303.999828z M563.299971 581.300251c44.499975-19.499989 75.699957-63.499964 76.699957-114.899935 1.299999-70.99996-56.099968-129.899926-127.099929-130.399926-71.09996-0.5-128.899927 56.999968-128.899927 127.999927 0 52.39997 31.499982 97.499945 76.699957 117.299934 11.699993 5.099997 19.299989 16.599991 19.299989 29.399983V896.000072c0 35.29998-28.699984 63.999964-63.999964 63.999964h-14.999991c-8.799995 0-15.999991 7.199996-15.999991 15.999991v31.999982c0 8.799995 7.199996 15.999991 15.999991 15.999991h222.999874c8.799995 0 15.999991-7.199996 15.999991-15.999991v-31.999982c0-8.799995-7.199996-15.999991-15.999991-15.999991h-15.999991c-35.29998 0-63.999964-28.699984-63.999964-63.999964V610.700234c0-12.799993 7.599996-24.299986 19.299989-29.399983zM512 528.000281c-35.29998 0-63.999964-28.699984-63.999964-63.999964s28.699984-63.999964 63.999964-63.999964 63.999964 28.699984 63.999964 63.999964-28.699984 63.999964-63.999964 63.999964z',
                symbolKeepAspect: true,
                name: 'eNB',
                value: [300, 500],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },{
                symbol:
                  'path://M975.999737 465.300316c-0.3 110.799937-39.499978 212.49988-104.599941 292.099835-11.999993 14.699992-34.099981 15.899991-47.499973 2.499999-11.599993-11.599993-12.499993-30.199983-2.099998-42.899976 24.099986-29.499983 43.799975-62.099965 58.699966-97.299945C901.399779 570.400257 911.999773 518.000287 911.999773 464.000317c0-53.999969-10.599994-106.39994-31.399982-155.699912-20.099989-47.599973-48.999972-90.399949-85.799951-127.199928s-79.499955-65.599963-127.199928-85.799951C618.39994 74.600538 565.999969 64.000544 512 64.000544S405.60006 74.600538 356.300088 95.400526c-47.599973 20.099989-90.399949 48.999972-127.199928 85.799951s-65.599963 79.499955-85.799951 127.199928C122.600221 357.600377 112.000227 410.000348 112.000227 464.000317s10.599994 106.39994 31.399982 155.699912c14.899992 35.29998 34.59998 67.899962 58.699967 97.299945 10.399994 12.699993 9.599995 31.299982-2.099999 42.899976-13.399992 13.399992-35.39998 12.299993-47.399973-2.299999C87.300241 677.600196 48.000263 575.400254 48.000263 464.000317 48.000263 207.500462 256.100145-0.39942 512.7 0.00058c257.099854 0.4 463.999737 208.199882 463.299737 465.299736z M815.999828 464.000317c0 66.599962-21.399988 128.199927-57.699968 178.199899-11.499993 15.899991-34.49998 17.49999-48.399972 3.699998-11.099994-11.099994-12.499993-28.699984-3.199998-41.399976 10.599994-14.599992 19.399989-30.299983 26.499985-47.099974 12.499993-29.499983 18.799989-60.999965 18.799989-93.399947s-6.299996-63.899964-18.799989-93.399947c-12.099993-28.599984-29.399983-54.199969-51.499971-76.299957-22.099987-22.099987-47.699973-39.399978-76.299957-51.499971-29.599983-12.499993-60.999965-18.799989-93.399947-18.799989s-63.799964 6.299996-93.399947 18.799989c-28.599984 12.099993-54.199969 29.399983-76.299957 51.499971-22.099987 22.099987-39.399978 47.699973-51.499971 76.299957-12.499993 29.499983-18.799989 60.999965-18.799989 93.399947s6.299996 63.799964 18.799989 93.399947c7.099996 16.699991 15.899991 32.499982 26.499985 47.099974 9.199995 12.799993 7.899996 30.299983-3.199998 41.399976-13.799992 13.799992-36.899979 12.199993-48.399972-3.699998-36.299979-49.999972-57.699967-111.599937-57.699968-178.199899 0-167.899905 136.099923-303.999828 303.999828-303.999828s303.999828 136.099923 303.999828 303.999828z M563.299971 581.300251c44.499975-19.499989 75.699957-63.499964 76.699957-114.899935 1.299999-70.99996-56.099968-129.899926-127.099929-130.399926-71.09996-0.5-128.899927 56.999968-128.899927 127.999927 0 52.39997 31.499982 97.499945 76.699957 117.299934 11.699993 5.099997 19.299989 16.599991 19.299989 29.399983V896.000072c0 35.29998-28.699984 63.999964-63.999964 63.999964h-14.999991c-8.799995 0-15.999991 7.199996-15.999991 15.999991v31.999982c0 8.799995 7.199996 15.999991 15.999991 15.999991h222.999874c8.799995 0 15.999991-7.199996 15.999991-15.999991v-31.999982c0-8.799995-7.199996-15.999991-15.999991-15.999991h-15.999991c-35.29998 0-63.999964-28.699984-63.999964-63.999964V610.700234c0-12.799993 7.599996-24.299986 19.299989-29.399983zM512 528.000281c-35.29998 0-63.999964-28.699984-63.999964-63.999964s28.699984-63.999964 63.999964-63.999964 63.999964 28.699984 63.999964 63.999964-28.699984 63.999964-63.999964 63.999964z',
                symbolKeepAspect: true,
                name: 'gNB',
                value: [800, 500],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              {
                symbol:
                  'path://M647.499 60.657H375.167c-89.602 0-162.497 72.895-162.497 162.497v573.907c0 89.602 72.895 162.497 162.497 162.497h272.332c89.602 0 162.497-72.895 162.497-162.497V223.154c0.001-89.602-72.895-162.497-162.497-162.497z m108.332 736.404c0 59.733-48.598 108.331-108.331 108.331H375.167c-59.733 0-108.331-48.598-108.331-108.331V223.154c0-59.733 48.598-108.332 108.331-108.332h56.168c0.15 14.827 12.193 26.81 27.055 26.81h105.885c14.863 0 26.905-11.983 27.055-26.81h56.168c59.733 0 108.331 48.598 108.331 108.332v573.907z M564.276 819.304H458.391c-14.956 0-27.083 12.126-27.083 27.083s12.126 27.083 27.083 27.083h105.885c14.956 0 27.083-12.126 27.083-27.083s-12.127-27.083-27.083-27.083z',
                symbolKeepAspect: true,
                name: '4G终端/UE',
                value: [100, 500],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },{
                symbol:
                  'path://M647.499 60.657H375.167c-89.602 0-162.497 72.895-162.497 162.497v573.907c0 89.602 72.895 162.497 162.497 162.497h272.332c89.602 0 162.497-72.895 162.497-162.497V223.154c0.001-89.602-72.895-162.497-162.497-162.497z m108.332 736.404c0 59.733-48.598 108.331-108.331 108.331H375.167c-59.733 0-108.331-48.598-108.331-108.331V223.154c0-59.733 48.598-108.332 108.331-108.332h56.168c0.15 14.827 12.193 26.81 27.055 26.81h105.885c14.863 0 26.905-11.983 27.055-26.81h56.168c59.733 0 108.331 48.598 108.331 108.332v573.907z M564.276 819.304H458.391c-14.956 0-27.083 12.126-27.083 27.083s12.126 27.083 27.083 27.083h105.885c14.956 0 27.083-12.126 27.083-27.083s-12.127-27.083-27.083-27.083z',
                symbolKeepAspect: true,
                name: '5G终端/UE',
                value: [1000, 500],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              {
                symbol:
                  'path://M341.333333 512c0 93.866667 76.8 170.666667 170.666667 170.666667s170.666667-76.8 170.666667-170.666667-76.8-170.666667-170.666667-170.666667-170.666667 76.8-170.666667 170.666667z m-85.333333 0c0-140.8 115.2-256 256-256V192C334.933333 192 192 334.933333 192 512s142.933333 320 320 320 320-142.933333 320-320h-64c0 140.8-115.2 256-256 256s-256-115.2-256-256z M800 512m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z M512 224m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z M202.666667 821.333333m-74.666667 0a74.666667 74.666667 0 1 0 149.333333 0 74.666667 74.666667 0 1 0-149.333333 0Z M842.666667 224m-74.666667 0a74.666667 74.666667 0 1 0 149.333333 0 74.666667 74.666667 0 1 0-149.333333 0Z M940.8 322.133333c-14.933333 14.933333-34.133333 27.733333-55.466667 34.133334 19.2 49.066667 32 100.266667 32 155.733333 0 224-181.333333 405.333333-405.333333 405.333333-66.133333 0-125.866667-14.933333-181.333333-42.666666-8.533333 21.333333-21.333333 38.4-38.4 53.333333C358.4 962.133333 433.066667 981.333333 512 981.333333c260.266667 0 469.333333-209.066667 469.333333-469.333333 0-68.266667-14.933333-132.266667-40.533333-189.866667zM512 106.666667c74.666667 0 145.066667 21.333333 206.933333 57.6 10.666667-19.2 23.466667-36.266667 40.533334-51.2C686.933333 68.266667 603.733333 42.666667 512 42.666667 251.733333 42.666667 42.666667 251.733333 42.666667 512c0 78.933333 19.2 153.6 55.466666 219.733333 14.933333-17.066667 32-29.866667 53.333334-38.4-27.733333-55.466667-42.666667-115.2-42.666667-181.333333C106.666667 288 288 106.666667 512 106.666667z',
                symbolKeepAspect: true,
                name: '核心网',
                value: [500, 100],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              {
                symbol:
                  'path://M84.48 708.48v242.24h847.36v-242.24H84.48z m409.6 166.4H186.24V784h307.84v90.88z m152 0c-24.96 0-45.44-20.48-45.44-45.44s20.48-45.44 45.44-45.44 45.44 20.48 45.44 45.44-20.48 45.44-45.44 45.44z m120.96 0c-24.96 0-45.44-20.48-45.44-45.44s20.48-45.44 45.44-45.44 45.44 20.48 45.44 45.44-20.16 45.44-45.44 45.44zM929.28 85.12H82.24v597.44h847.36V85.12z m-205.76 464.96v60.48c-103.36 0-192.32-48.96-234.88-119.68-43.84 66.88-130.88 112.64-230.72 112.64v-60.48c110.72 0 200.64-67.84 200.64-151.36 0-68.8-61.44-127.04-144.96-145.28l-9.92 37.44-43.52-43.52h-2.24v-2.24L198.08 178.24l144-38.72-12.8 48.32c72 16.64 131.2 57.6 163.52 111.36 31.68-48.32 86.08-85.44 151.36-102.4l-11.2-41.28 144 38.72-105.6 105.6-11.84-44.8c-79.36 20.16-136.64 76.8-136.64 143.36 0 83.84 89.92 151.68 200.64 151.68z',
                symbolKeepAspect: true,
                name: 'OVS交换机',
                value: [500, 500],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              {
                symbol:
                  'path://M880.851458 4.324585H139.613566c-75.670277 0-138.506301 61.550606-138.506301 138.496337v741.237892c0 75.660312 61.56057 138.496336 138.496336 138.496336h741.237893c75.660312 0 138.496336-61.56057 138.496336-138.496336V142.820922c0.009964-76.945731-61.540641-138.496336-138.486372-138.496337z m66.821817 873.446641c0 40.336223-32.783146 73.119369-73.119369 73.119369H145.901154c-40.346188 0-73.119369-32.773182-73.119369-73.119369V149.10851c0-40.346188 32.773182-73.119369 73.119369-73.11937h728.662716c40.336223 0 73.119369 32.773182 73.119369 73.11937V877.771226z m7.553077 6.287588 M280.680739 494.198453V145.381793c0-17.955997-14.109707-32.055739-32.065704-32.055738s-32.055739 14.109707-32.055739 32.055738v350.102078c-52.572607 14.109707-91.055437 61.550606-91.055437 119.264886 0 57.704316 38.472865 105.155179 91.055437 119.264886v162.869459c0 17.955997 14.109707 32.055739 32.055739 32.055739 17.955997 0 32.065703-14.109707 32.065704-32.055739V732.728225c52.572607-14.099742 91.055437-61.550606 91.055437-119.264886-0.009964-57.704316-38.48283-105.155179-91.055437-119.264886z m-30.780286 179.550002h-2.560871c-32.055739 0-58.989734-26.933995-58.989734-58.989734 0-33.341157 26.933995-58.989734 58.989734-58.989734s58.989734 26.924031 58.989733 58.989734c2.560872 30.770321-24.373123 57.704316-56.428862 58.989734z m541.180986-87.209147V145.381793c0-17.955997-14.109707-32.055739-32.055739-32.055738-17.955997 0-32.055739 14.109707-32.055738 32.055738v441.147551c-52.582572 14.109707-91.055437 61.56057-91.055438 119.264886 0 56.428862 38.472865 105.155179 91.055438 119.264885v71.814023c0 17.955997 14.109707 32.055739 32.055738 32.055739 17.955997 0 32.055739-14.109707 32.055739-32.055739V825.059115c52.582572-14.109707 91.055437-61.56057 91.055437-119.264885-0.009964-57.694351-38.472865-105.145215-91.055437-119.254922z m-32.065703 178.25462c-33.341157 0-58.989734-26.933995-58.989734-58.989734 0-33.341157 26.933995-58.989734 58.989734-58.989734 33.341157 0 58.989734 26.933995 58.989734 58.989734s-25.638612 58.989734-58.989734 58.989734z m-216.727485-511.686119v-109.011434c0-17.955997-14.109707-32.055739-32.055739-32.055739-17.955997 0-32.055739 14.109707-32.055739 32.055739v109.011434c-52.582572 14.109707-91.055437 61.56057-91.055437 119.264886 0 56.428862 38.472865 105.155179 91.055437 119.264886v403.960103c0 17.955997 14.109707 32.055739 32.055739 32.055739 17.955997 0 32.055739-14.109707 32.055739-32.055739v-403.960103c52.582572-14.109707 91.055437-61.550606 91.055437-119.264886 0-56.428862-38.472865-105.155179-91.055437-119.264886z m-32.055739 179.540038c-33.341157 0-58.989734-26.924031-58.989734-58.989734 0-33.341157 26.933995-58.989734 58.989734-58.989734 33.341157 0 58.989734 26.924031 58.989734 58.989734 0 32.055739-25.648577 58.989734-58.989734 58.989734z m0 0',
                symbolKeepAspect: true,
                name: '控制器',
                value: [500, 900],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              {
                symbol:
                  'path://M512 320c-141.216 0-256 114.816-256 256 0 141.216 114.816 256.064 256 256.064s256-114.88 256-256.064c0-141.184-114.816-256-256-256z m-16 35.264v84.736h-157.568c37.76-48.128 92.8-79.936 157.568-84.736z m32 0c64.768 4.8 119.84 36.608 157.568 84.736H528v-84.736zM316.864 472H496v88H291.264c2.368-31.968 11.264-61.184 25.6-88z m211.136 0h179.136c14.336 26.816 23.232 56.032 25.6 88H528v-88zM291.2 592h204.8v88.064H316.864A219.008 219.008 0 0 1 291.2 592z m236.8 0h204.8a218.976 218.976 0 0 1-25.664 88.064H528V592z m-189.568 120.064H496v84.768c-64.768-4.8-119.84-36.64-157.568-84.768z m189.568 0h157.568c-37.76 48.128-92.8 79.936-157.568 84.768v-84.768z M414.624 346.56c-62.016 152.736-72.32 298.656-4.672 457.184l29.44-12.544c-64.448-151.104-55.04-285.12 4.864-432.576l-29.632-12.064z m192.96 0l-29.632 12.064c59.84 147.456 69.312 281.472 4.864 432.576l29.44 12.544c67.616-158.528 57.344-304.448-4.704-457.184z M80 64a16 16 0 0 0-16 16v864a16 16 0 0 0 16 16h864a16 16 0 0 0 16-16V476.32a16 16 0 1 0-32 0V928H96V96h832v233.76a16 16 0 1 0 32 0V80a16 16 0 0 0-16-16h-864z m863.744 307.136a16 16 0 0 0-15.744 16.256v28.416a16 16 0 1 0 32 0v-28.416a16 16 0 0 0-16.256-16.256z M80 192v32h864V192h-864z M160 144.032a16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16 16 16 0 0 1 16 16z m64 0a16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16 16 16 0 0 1 16 16z m64 0a16 16 0 0 1-16 16 16 16 0 0 1-16-16 16 16 0 0 1 16-16 16 16 0 0 1 16 16z',
                symbolKeepAspect: true,
                name: 'Web',
                value: [700, 200],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              {
                symbol:
                  'path:// "M604.437333 760.896a92.437333 92.437333 0 1 0-184.874666 0 92.437333 92.437333 0 0 0 184.874666 0z m-142.208 0a49.770667 49.770667 0 1 1 99.541334 0 49.770667 49.770667 0 0 1-99.541334 0z m49.770667-234.666667c-63.061333 0-122.24 25.024-165.930667 68.714667a21.333333 21.333333 0 1 0 30.165334 30.186667A191.296 191.296 0 0 1 512 568.896c51.626667 0 99.968 20.437333 135.765333 56.234667a21.333333 21.333333 0 0 0 30.165334-30.186667A233.962667 233.962667 0 0 0 512 526.229333z m0-177.792c-110.848 0-214.826667 43.968-291.626667 120.810667a21.333333 21.333333 0 1 0 30.144 30.165333A368.490667 368.490667 0 0 1 512 391.104c99.413333 0 192.554667 39.402667 261.482667 108.309333a21.333333 21.333333 0 0 0 30.165333-30.165333A411.136 411.136 0 0 0 512 348.437333zM512 170.666667a588.330667 588.330667 0 0 0-417.344 172.864 21.333333 21.333333 0 1 0 30.165333 30.186666A545.664 545.664 0 0 1 512 213.333333c147.2 0 285.141333 58.346667 387.2 160.384a21.333333 21.333333 0 1 0 30.144-30.186666A588.330667 588.330667 0 0 0 512 170.666667z',
                symbolKeepAspect: true,
                name: 'WiFi',
                value: [700, 800],
                label: {
                  show: true,
                  position: 'bottom',
                  fontWeight: 'bolder',
                  fontSize: 15
                }
              },
              // {
              //   symbol:
              //     'path:// M762.88 976.512H258.56c-114.56 0-207.36-92.8-207.36-207.36V264.704c0-114.56 92.8-207.36 207.36-207.36h504.32c114.56 0 207.36 92.8 207.36 207.36v504.448c0 114.56-92.8 207.36-207.36 207.36z M671.488 385.024L512.896 228.736c-12.672-12.544-34.176-3.456-34.176 14.336V439.168l-100.096-93.952c-1.408-1.408-3.712-1.28-5.12 0.128l-28.544 30.336c-1.408 1.408-1.28 3.712 0.128 5.12l133.632 125.44v18.816l-133.504 124.16c-1.408 1.408-1.536 3.712-0.128 5.12l28.416 30.464c1.408 1.408 3.712 1.536 5.12 0.128l100.224-93.184v198.912c0 17.792 21.504 26.88 34.176 14.336L671.488 648.96c7.936-7.808 7.936-20.736 0-28.672L581.12 531.328c-7.936-7.808-7.936-20.736 0-28.672l90.368-89.088c8.064-7.808 8.064-20.736 0-28.544z m-143.872-73.088l87.552 86.272-87.04 80.896-0.512-0.512V311.936z m0 243.328l1.664-1.536 86.656 81.28-88.192 86.912V555.264z',
              //   symbolKeepAspect: true,
              //   name: '蓝牙',
              //   value: [700, 200],
              //   label: {
              //     show: true,
              //     position: 'bottom',
              //     fontWeight: 'bolder',
              //     fontSize: 15
              //   }
              // }
            ]
          },
          {
            type: 'lines',
            polyline: true,
            coordinateSystem: 'cartesian2d',
            lineStyle: {
              type: 'dashed',
              width: 2,
              curveness: 0.3,
              color: '#5DDBD2'
            },
            effect: {
              show: true,
              trailLength: 0.1,
              symbol: 'arrow',
              color: 'orange',
              symbolSize: 8
            },
            data: [
              [
                [120, 520],
                [270, 520]
              ],[
                [270, 480],
                [120, 480]
              ],
              
              // [
              //   [120, 220],
              //   [270, 220]
              // ],[
              //   [270, 180],
              //   [120, 180]
              // ],
              
              [
                [330, 520],
                [465, 520]
              ],
              [
                [465, 480],
                [330, 480]
              ],

              // [
              //   [465, 480],
              //   [330, 220]
              // ],
              // [
              //   [330, 180],
              //   [465, 450]
              // ],

              [
                [495, 740],
                [495, 600]
              ],
              [
                [505, 600],
                [505, 740]
              ],

               [
                [495, 200],
                [495, 360]
              ],
              [
                [505, 360],
                [505, 200]
              ],

               [
                [525, 510],
                [770, 510]
              ],
              [
                [770, 480],
                [525, 480]
              ],
              [
                [525, 520],
                [670, 720]
              ],
              [
                [670, 750],
                [525, 540]
              ],
              [
                [525, 470],
                [670, 220]
              ],
              [
                [670, 190],
                [525, 440]
              ],
              [
                [825, 520],
                [970, 520]
              ],
              [
                [970, 480],
                [825, 480]
              ],
 

            ]
          }
        ]
      }
      myChart.setOption(option)
    }
  },
  mounted () {
    let flag = true
    setTimeout(() => {
      this.myEcharts()
      setInterval(() => {
        if (this.checkEveryTime) {
          if (flag) {
            this.baseConnected()
            flag = false
          } else {
            this.ueConnected()
            flag = true
          }
        }
      }, 3000)
    }, 500)
  }
}
</script>

<style lang="scss" scoped>
.page {
  .logo {
    width: 120px;
  }
  .btn-group {
    color: $color-text-placehoder;
    font-size: 12px;
    line-height: 12px;
    margin-top: 0px;
    margin-bottom: 20px;
    width: 90%;
    .btn-group__btn {
      color: $color-text-sub;
      &:hover {
        color: $color-text-main;
      }
      &.btn-group__btn--link {
        color: $color-primary;
      }
    }
  }
}
.Echarts {
  margin-top: 20px;
}

.my-label {
  background: #e1f3d8;
}

.my-content {
  background: #fde2e2;
}
.box-card {
  width: 15%;
}
</style>
